/**
 * @Author: zhoujie
 * @Date: 2019/08/24
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-12-19 15:50:46
 */

const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

/** 结算管理 菜单路由 */
const menuRoutes = [
  /** 结算管理 S */
  {
    path: '/finance',
    meta: { title: '资金结算', icon: 'el-icon-s-order' },
    redirect: '/finance',
    component: RouteView,
    children: [
      {
        path: '/finance/salesFinance',
        meta: { title: '销售结算' },
        redirect: '/finance/salesFinance',
        component: RouteView,
        children: [
          {
            path: '/finance/salesFinance/salesFinance',
            meta: { title: '销售结算', keepAlive: true },
            component: AsyncComponent('finance/salesFinance/salesFinance')
          }
        ]
      },
      {
        path: '/finance/repairFinance',
        meta: { title: '维修结算' },
        redirect: '/finance/repairFinance',
        component: RouteView,
        children: [
          {
            path: '/finance/repairFinance/cancelFinance',
            meta: { title: '取消结算', keepAlive: true },
            component: AsyncComponent('finance/repairFinance/cancelFinance')
          },
          {
            path: '/finance/repairFinance/receivables',
            meta: { title: '维修收款', keepAlive: true },
            component: AsyncComponent('finance/repairFinance/receivables')
          },
          {
            path: '/finance/repairFinance/closeBalance',
            meta: { title: '结算关单', keepAlive: true },
            component: AsyncComponent('finance/repairFinance/closeBalance')
          }
        ]
      },
      {
        path: '/finance/partFinance',
        meta: { title: '配件结算' },
        redirect: '/finance/partFinance',
        component: RouteView,
        children: [
          {
            path: '/finance/partFinance/invoiceRegister',
            meta: { title: '发票登记', keepAlive: true },
            component: AsyncComponent('finance/partFinance/invoiceRegister')
          }
        ]
      },
      {
        path: '/finance/advancesReceived',
        meta: { title: '预收款管理' },
        redirect: '/finance/advancesReceived',
        component: RouteView,
        children: [
          {
            path: '/finance/advancesReceived/register',
            meta: { title: '预收款登记', keepAlive: true },
            component: AsyncComponent('finance/advancesReceived/register')
          },
          {
            path: '/finance/advancesReceived/registerQuery',
            meta: { title: '预收款明细', keepAlive: true },
            component: AsyncComponent('finance/advancesReceived/registerQuery')
          },
          {
            path: '/finance/advancesReceived/registerMaintain',
            meta: { title: '维护预收款', keepAlive: true },
            component: AsyncComponent('finance/advancesReceived/registerMaintain')
          },
          {
            path: '/finance/advancesReceived/registerConfirm',
            meta: { title: '预收款确认', keepAlive: true },
            component: AsyncComponent('finance/advancesReceived/registerConfirm')
          },
          {
            path: '/finance/advancesReceived/registerSearch',
            meta: { title: '预收款查询', keepAlive: true },
            component: AsyncComponent('finance/advancesReceived/registerSearch')
          }
        ]
      }
    ]
  }
  /** 结算管理 E */
];

export default menuRoutes;
